[#ftl]
[#assign fields = formFields /]
[#assign grid = '#grid' /]
[#assign pager = '#pagination' /]
<%@ page pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/view/include/taglibs.jspf" %>
[#assign ctx = '$'+'{ctx}' /]
<m:h>
    <link rel="stylesheet" href="${ctx}/js/lib/jqgrid/css/jquery-ui.min.css">
    <link rel="stylesheet" href="${ctx}/js/lib/jqgrid/css/jquery-ui.theme.min.css">
    <link rel="stylesheet" href="${ctx}/js/lib/jqgrid/css/ui.jqgrid.css">
    <link rel="stylesheet" href="${ctx}/css/jquery.gritter.css">
    <script src="${ctx}/js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="${ctx}/js/lib/jqgrid/js/i18n/grid.locale-cn.js" type="text/javascript"></script>
    <script src="${ctx}/js/lib/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
    <script src="${ctx}/js/lib/jqgrid.custom.js" type="text/javascript"></script>
    <script src="${ctx}/js/lib/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="${ctx}/js/lib/jquery.gritter.min.js" type="text/javascript"></script>
    <script src="${ctx}/js/lib/jquery-validation-1.13.0/jquery.validate.min.js" type="text/javascript"></script>
</m:h>
<!-- Begin 当前位置 -->
<div class="position">
    <span>您当前的位置：</span><a href="${ctx}/admin" title="首页">首页</a> &gt; 微店商系统 &gt; <a href="${ctx}/admin/brand/index">品牌管理</a>
</div>
<!-- //End 当前位置 -->
<div class="listPage">
    <!-- Begin 操作条 -->
    <div class="operateBar">
        <ul>
            <li><a class="operate-delete" href="javascript:void(0);"><s class="icon-delete"></s>删除</a>
            </li>
            <li><a class="operate-add" href="add" class=""><s class="icon-add-green"></s>新增</a></li>
        </ul>
    </div>
    <!-- //End 操作条 -->
    <div class="table-module03" style="border: none;">
        <table id="grid"></table>
        <div id="pagination"></div>
    </div>
</div>
<script type="text/javascript">
    (function($) {
        var $grid = $('${grid}').jqGrid({
            url: 'list',
            datatype: 'json',
            colNames: [ '操作'[#list fields as f], '${f.name}'[/#list] ],
            colModel: [
                { template: 'actions3', width: 150 },
            [#list fields as field]
                [#assign type = field.type /]
                [#if 'java.lang.Boolean' == type || 'boolean' == type]
                    [#assign tpl = 'bool' /]
                [#elseif 'java.lang.Integer' == type || 'int' == type || 'java.lang.Long' == type || 'long' == type || 'java.lang.Byte' == type || 'byte' == type]
                    [#assign tpl = 'int' /]
                [#elseif 'java.lang.Float' == type || 'float' == type || 'java.lang.Double' == type || 'double' == type]
                    [#assign tpl = 'num' /]
                [#elseif 'java.util.Date' == type]
                    [#assign tpl = 'date' /]
                [#else]
                    [#assign tpl = 'text' /]
                [/#if]
                [#if 'id' == field.name]
                { name: 'id', index: 'id', hidden: true, key: true },
                [#else]
                { name: '${field.name}', index: '${field.name}', template: '${tpl}' }[#if field_has_next],[/#if]
                [/#if]
            [/#list]
            ],
            pager: '${pager}',
            multiselect: true,
            autowidth: true,
            height: 'auto'
        });
    })(jQuery);
</script>
<script src="${ctx}/js/admin/common.js" type="text/javascript"></script>
<m:message message="${'$'}{message}" error="${'$'}{error}"/>
<m:f />
